<ui:composition template="/pages/workspace_page.xhtml"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:nxd="http://nuxeo.org/nxweb/document"
  xmlns:nxl="http://nuxeo.org/nxforms/layout"
  xmlns:nxu="http://nuxeo.org/nxweb/util">

  <ui:define name="page title">
    <h:outputText
      value="#{nuxeoApplicationName} - #{messages['title.email.document']}" />
  </ui:define>

  <ui:define name="body">
    <ui:include src="/incl/message_banner.xhtml" />

    <div class="mainNoTabs">

      <h:panelGroup rendered="#{currentDocument.version}">
        <h3>
          <h:outputText
            value="#{nxd:titleOrId(versionedActions.sourceDocument)}" />
          (version
          <h:outputText value=" #{currentDocument.uid.major_version}" />
          .
          <h:outputText value="#{currentDocument.uid.minor_version}" />
          )
        </h3>
      </h:panelGroup>
      <h:panelGroup rendered="#{! currentDocument.version}">
        <h3>
          <h:outputText value="#{nxd:titleOrId(currentDocument)}" />
        </h3>
      </h:panelGroup>

      <h:form id="document_send">
        <table class="dataInput">
          <tbody>
            <tr>
              <td class="labelColumn"><h:outputText
                  value="#{messages['label.mail.recipients']}" /></td>
              <td class="fieldColumn"><nxl:widgetType
                  name="multipleUsersSuggestion" mode="edit"
                  value="#{emailNotifSenderAction}"
                  displayEmailInSuggestion="true" field="recipients"
                  translated="true" width="100%" prefixed="true"
                  placeholder="label.email.search.users" /></td>
            </tr>
            <tr>
              <td class="labelColumn"><h:outputText
                  value="#{messages['label.email.subject']}" /></td>
              <td class="fieldColumn"><h:inputText id="h_inputText"
                  value="#{emailNotifSenderAction.mailSubject}" /> <h:message
                  styleClass="errorMessage" for="h_inputText" /></td>
            </tr>
            <tr>
              <td class="labelColumn"><h:outputText
                  value="#{messages['label.mail.text']}" /></td>
              <td><nxu:editor id="nxu_editor" rendered="true"
                  required="false" value="#{emailNotifSenderAction.mailContent}" /></td>
            </tr>
          </tbody>
        </table>
        <div class="buttonsGadget">
          <h:commandButton value="#{messages['command.email.send']}"
            styleClass="button primary"
            action="#{emailNotifSenderAction.send}" />
          <h:commandButton immediate="true"
            value="#{messages['command.cancel']}"
            action="#{navigationContext.goBack()}" />
        </div>

      </h:form>
    </div>

  </ui:define>

  </ui:composition>